Initial support for baselines
authorAlexander Larsson <alexl@redhat.com>
Tue, 5 Mar 2013 13:54:03 +0000 (14:54 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 23 Apr 2013 03:50:37 +0000 (05:50 +0200)
commit852cbb62b8b98bb3345604ce1dcf4186613f74e8
tree58315efdf359698bb49c6b0febfc86b28db40337
parentf15bc7818e0941da80c4ee380a25daf7fcd99d72
Initial support for baselines

This modifies the size machinery in order to allow baseline support.

We add a new widget vfunc get_preferred_height_and_baseline_for_width
which queries the normal height_for_width (or non-for-width if width
is -1) and additionally returns optional (-1 means "no baseline")
baselines for the minimal and natural heights.

We also add a new gtk_widget_size_allocate_with_baseline() which
baseline-aware containers can use to allocate children with a specific
baseline, either one inherited from the parent, or one introduced due
to requested baseline alignment in the container
itself. size_allocate_with_baseline() works just like a normal size
allocation, except the baseline gets recorded so that the child can
access it via gtk_widget_get_allocated_baseline() when it aligns
itself.

There are also adjust_baseline_request/allocation similar to the
allocation adjustment, and we extend the size request cache to also
store the baselines.
gtk/gtkcontainer.c
gtk/gtksizerequest.c
gtk/gtksizerequestcache.c
gtk/gtksizerequestcacheprivate.h
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwidgetprivate.h